﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using UI.WebPage.Background;
using BLL.AuthModel;
using Model.AuthModel;
using Com.Ompchina.Lib.Net;
namespace Com.Ompchina.Web.admin.system
{
    public partial class list_staff : ListInfoPage, IListInfo
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && PageAction.Equals("list")) { this.InitParameter(); }
        }

        #region IListPage 成员

        public void InitParameter()
        {            
            txtKey.Text = Server.UrlDecode(RequestParam.GetString(Request, "key"));
        }

        public void ExecuteUpdate()
        {
            throw new NotImplementedException();
        }

        #endregion

        #region 私有方法
        /// <summary>
        /// 根据角色获取成员列表
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        protected IList<StaffInfo> _GetStaff(int pageSize, out int recordCount)
        {
            return new StaffBLL().BackList(Server.HtmlEncode(txtKey.Text), PageIndex, pageSize, out recordCount);
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtKey.Text.Trim()))
            {
                Response.Redirect(string.Format("list_staff.aspx?action=list&key={1}"
                    ,Server.UrlEncode(txtKey.Text))
                    );
            }
        }
        #endregion
    }
}
